#ifndef _THREADSDLG_H_
#define _THREADSDLG_H_

struct threadsdlg;

/* threadsdlg_new: Create a new thread dialog.
 * ____________
 *
 *   pos_r:   position of the viewer (row)
 *   pos_c:   position of the viewer (column)
 *   height:  height (in lines) of the viewer
 *   width:   width (in columns) of the viewer
 *
 * return value:  a new threadsdlg object on success, null on failure.
 */
struct threadsdlg *threadsdlg_new(int pos_r, int pos_c, int height, int width);

/* threadsdlg_free:  Release the memory associated with a thread dialog.
 * ------------
 *
 *   fdlg:  The thread dialog to free.
 */
void threadsdlg_free(struct threadsdlg *thrd);

/* threadsdlg_add_thread_choice:  Add a thread to the list of source threads.
 * -----------
 *
 * thread_choice: A path to a thread that the user will be able to choose from.
 *
 * Return Value:  Zero on success, non-zero on error.
 */
int threadsdlg_add_thread(struct threadsdlg *thrd, const char *thread_choice);

/* threadsdlg_clear: Clears all the thread_choice's in the dialog.
 * ______________
 */
void threadsdlg_clear(struct threadsdlg *thrd);

/* threadsdlg_recv_char: Sens a character to the threadsdlg.
 *
 *   fdlg:  The thread dialog to free.
 *   key :  The next key of input to process
 *   thread:  The thread the user selected
 *
 *  returns -1 when aborted by user.
 *  returns 0 when needs more input
 *  returns 1 when done ( thread is valid )
 */
int threadsdlg_recv_char(struct threadsdlg *thrd, int key, char *thread);

/* threadsdlg_display_message: Displays a message on the threadsdlg window status bar.
 * ------------------------
 *
 * fd:      The thread dialog to use.
 * message: The message to display
 */
void threadsdlg_display_message(struct threadsdlg *thrd, char *message);

/* threadsdlg_display: Redraws the thread dialog.
 *
 * Returns 0 on success or -1 on error
 */
int threadsdlg_display( struct threadsdlg *thrd, bool is_in_focus);

#endif /* _THREADSDLG_H_*/
